
<script type="text/javascript">
		$(function(){
			$('#update-btn').click(function() {
				if($("#edit-profile-form").form('validate')) $('#edit-profile-form').submit();
			});
		
			$('#edit-profile-form').form({
				onSubmit: function(){  
			        return $("#edit-profile-form").form('validate');  
			    },
				success:function(result){
					var result = eval('('+result+')');

					if (result.success){
						$.messager.show({
							title: 'Success',
							msg: result.msg
						});
					} else {
						$.messager.show({
							title: 'Error',
							msg: result.msg
						});
					}

				}
			});
		});
	</script>


<div class="easyui-layout" style="width:100%;height:1000px;">
	<div region="north" style="overflow:hidden;height:70px;padding-left:25px;">
		<table align="left">
			<tr>
				<td>
					<img src="<?= base_url()?>assets/default/images/user/user-profile.png"/>
				</td>
				<td valign="middle">
					<h1>Edit profile</h1>
				</td>
			</tr>
		</table>
	</div>
	<div region="south" split="true" style="height:50px;background:#fafafa;">
	</div>
	<div region="east" icon="icon-reload" title="Notifications" split="true" style="width:250px;">
	</div>
	<div region="west" split="true" title="Navigation" style="width:200px;">
		<?= $navigation?>
	</div>
	<div region="center" title="User Profile" style="background:#fafafa;padding:10px;">
		
		
		<div id="win" class="easyui-panel" title="Personal Information" style="padding:10px;">
			<form id="edit-profile-form" action="<?= site_url("user/edit_profile")?>" method="post">
			<table>
					<tr>
						<td width="150px">First name:</td>
						<td><input class="easyui-validatebox" size="40" name="firstname" type="text" value="<?= $userData["firstname"]?>" required="true"/></td>
					</tr>
					<tr>
						<td>Last name:</td>
						<td><input class="easyui-validatebox" size="40" name="lastname" type="text" value="<?= $userData["lastname"]?>" required="true"/></td>
					</tr>
					<tr>
						<td>Email:</td>
						<td><input readonly="true" size="40" name="email" type="text" value="<?= $userData["email"]?>"/></td>
					</tr>
					<tr>
						<td></td>
						<td align="right"><a href="#" class="easyui-linkbutton" iconCls="icon-ok" id="update-btn" >Update</a></td>
					</tr>
				</table>
			</form>
		</div>				
	</div>
</div>






